import { Navigate, useNavigate, useLocation } from 'react-router-dom';
import { useSelector } from 'react-redux';
const index = ({ children, path = '/login' }) => {
  const { token } = useSelector((state) => state.counter.userInfo);
  return token ? children : <Navigate to={path} />;
};
export default index;
